import { Link } from 'umi';

const ProjectItemLink = (props) => {
    const {
        projectId,
        type,
        name,
        id,
    } = props;

    const pathType = () => {
        if (type === "PROD") {
            return "prod"
        }
        if (type === "DEV") {
            return "dev"
        }
        if (type === "QA") {
            return "qa"
        }
        if (type === "TASK") {
            return "task"
        }
        if (type === "BUG") {
            return "bug"
        }
        return type;
    }

    return <Link to={{
        pathname: `/projects/${projectId}/${pathType()}/${id}`,
    }}>{name}</Link>
}

export default ProjectItemLink;